<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<!-- HTML file produced from file: manual.tex --
 -- using Hyperlatex v 2.3.1 (c) Otfried Cheong--
 -- on Emacs 21.4 (patch 12) "Portable Code" XEmacs Lucid, Wed Jun  2 18:56:53 2004 -->
<HEAD>
<TITLE>Scheme 48 Manual -- Debugging commands</TITLE>

</HEAD><BODY BGCOLOR="#ffffff">
<EM>Scheme 48 Manual</EM> | <A HREF="s48manual.html#top_node">Contents</A> | In Chapter: <A HREF="s48manual_11.html">Command processor</A><BR>Previous: <A HREF="s48manual_15.html">Module commands</A> | Next: <A HREF="s48manual_17.html">Switches</A>
<H2>Debugging commands</H2>

<P><DL><DT><B></B><DD><CODE>,preview</CODE><BR>Somewhat like a backtrace, but because of tail recursion you see
    less than you might in debuggers for some other languages.
    The stack to display is chosen as follows:
<OL><LI>If the current focus object is a continuation or a thread,
       then that continuation or thread's stack is displayed.
    <LI>Otherwise, if the current command level was initiated because of
       a breakpoint in the next level down, then the stack at that
       breakpoint is displayed.
    <LI>Otherwise, there is no stack to display and a message is printed
       to that effect.
</OL>
    One line is printed out for each continuation on the chosen stack,
    going from top to bottom.
<P><DT><B></B><DD><CODE>,run <CODE><I>exp</I></CODE></CODE><BR>Evaluate <CODE><I>exp</I></CODE>, printing the result(s) and making them
    (or a list of them, if <CODE><I>exp</I></CODE> returns multiple results)
    the new focus object.
    The <CODE>,run</CODE> command is useful when writing
    <A HREF="s48manual_19.html">command programs</A>.
<P><DT><B></B><DD><CODE>,trace <CODE><I>name</I></CODE> ...</CODE><BR>Start tracing calls to the named procedure or procedures.
    With no arguments, displays all procedures currently traced.
    This affects the binding of <CODE><I>name</I></CODE>, not the behavior of the
    procedure that is its current value.  <CODE><I>Name</I></CODE> is redefined
    to be a procedure that prints a message,
    calls the original value of <CODE><I>name</I></CODE>, prints another
    message, and finally passes along the value(s) returned by the
    original procedure.
<P><DT><B></B><DD><CODE>,untrace <CODE><I>name</I></CODE> ...</CODE><BR>Stop tracing calls to the named procedure or procedures.
    With no argument, stop tracing all calls to all procedures.
<P><DT><B></B><DD><CODE>,condition</CODE><BR>The <CODE>,condition</CODE> command displays the condition object
    describing the error or interrupt that initiated the current
    command level.  The condition object becomes the current focus
    value.  This is particularly useful in conjunction with
    the inspector.  For example, if a procedure is passed the wrong number of
    arguments, do <CODE>,condition</CODE> followed by
     <CODE>,inspect</CODE> to inspect the
    procedure and its arguments.
<P><DT><B></B><DD><CODE>,bound? <CODE><I>name</I></CODE></CODE><BR>Display the binding of <CODE><I>name</I></CODE>, if there is one, and otherwise
    prints `<CODE>Not bound</CODE>'.
<P><DT><B></B><DD><CODE>,expand <CODE><I>form</I></CODE></CODE>
<DT><B></B><DD><CODE>,expand-all <CODE><I>form</I></CODE></CODE><BR>Show macro expansion of <CODE><I>form</I></CODE>, if any.
    <CODE>,expand</CODE> performs a single macro expansion while
    <CODE>,expand-all</CODE> fully expands all macros in <CODE><I>form</I></CODE>.
<P><DT><B></B><DD><CODE>,where <CODE><I>procedure</I></CODE></CODE><BR>Display name of file containing <CODE><I>procedure</I></CODE>'s source code.
</DL>
<P><P>
  
Previous: <A HREF="s48manual_15.html">Module commands</A> | Next: <A HREF="s48manual_17.html">Switches</A></BODY></HTML>
